

#ifndef ASSERTIONS_H_INCLUDED
#define ASSERTIONS_H_INCLUDED

void reportAssertionFailed(const char* expression, const char* file, const int line, const bool message);

#ifdef ASSERTIONS_ENABLED
    ///defines a debug break that will break into the debugger
    ///may need to be changed.
    #define debugBreak() __builtin_trap()

    #define ASSERT(expression)  \
        if (expression)         \
            { }                 \
        else                    \
        {                       \
            reportAssertionFailed(#expression, \
                                  __FILE__,    \
                                  __LINE__,    \
                                  false);      \
            debugBreak();       \
        }

    #define ASSERT_MESSAGE(expression, string)  \
        if (expression)         \
            { }                 \
        else                    \
        {                       \
            reportAssertionFailed(#string, \
                                  __FILE__,    \
                                  __LINE__,    \
                                  true);      \
            debugBreak();       \
        }

#else
    #define ASSERT(expression) { }

#endif

#endif // ASSERTIONS_H_INCLUDED
